<script setup>
import { ref, reactive } from 'vue'
import axios from 'axios'
let message = reactive({
  "code": 0,
  "content": ""
})

function getLoveMessage() {
  let promise = axios({
    method: 'get',
    url: 'https://api.uomg.com/api/rand.qinghua?format=json',
    data: {
      
    }

  })
  promise.then(
    function (response) {
      console.log(response)
      // message.code = response.data.code
      // message.content = response.data.content
      Object.assign(message, response.data)
    }
  ).catch(
    function (error) {
      console.log(error)
    }
  )}
 console.log("执行完毕")
</script>

<template>
  <div>
    <h3 v-text="message"></h3>
    <button @click="getLoveMessage">点</button>
  </div>

</template>

<style scoped>

</style>
